/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.suarte.core.service.impl;

import com.suarte.core.Company;
import com.suarte.core.Contact;
import com.suarte.core.Currency;
import com.suarte.core.DocumentStatus;
import com.suarte.core.Invoice;
import com.suarte.core.InvoicePayment;
import com.suarte.core.Payment;
import com.suarte.core.dao.InvoiceDao;
import com.suarte.core.service.InvoiceManager;
import java.util.Date;
import java.util.List;
import org.appfuse.service.impl.GenericManagerImpl;


/**
 * @date   Dec 20, 2010
 * @author Ggutierrez
 */
public class InvoiceManagerImpl extends GenericManagerImpl<Invoice, Long> implements InvoiceManager {
    InvoiceDao invoiceDao;

    public InvoiceManagerImpl(InvoiceDao invoiceDao) {
        super(invoiceDao);
        this.invoiceDao = invoiceDao;
    }

    public void store(Invoice object) {
        invoiceDao.store(object);
    }

    @Override
    public Invoice get(Long id) {
        return invoiceDao.get(id);
    }

    public List<Invoice> findByDescription(String description) {
        return invoiceDao.findByDescription(description);
    }

    public List<Invoice> findInvoices(Long id, Long quotationId, String description, Date date, Company company, Contact contact, DocumentStatus status, Date fromExpirationDate, Date toExpirationDate) {
        return invoiceDao.findInvoices(id, quotationId, description, date, company, contact, status, fromExpirationDate, toExpirationDate);
    }

    public List<Invoice> findPendingInvoices(Company company, Currency currency){
        return invoiceDao.findPendingInvoices(company, currency);
    }

    public List<InvoicePayment> findInvoiceByPayment(Payment payment) {
        return invoiceDao.findInvoiceByPayment(payment);
    }
}
